<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('home', function(){
    echo 'this is home page';
});

Route::get('/user/{id}', function($id){
    echo ' 我要删除id为'.$id.'的用户';
})->where('id', '[0-9]+');;

Route::get('/404', function(){
    abort(404);
});

/**
 * 路由组
 */
Route::group(['middleware' => 'ALogin'], function(){
    //后台首页
    Route::get('admin/index', 'Admin\AdminController@index');
    //后台用户管理(隐式控制器路由)
    Route::controller('admin/user', 'Admin\UserController');
    //后台分类管理
    Route::controller('admin/cate', 'Admin\CateController');
});


//后台用户登录
Route::controller('admin/login','Admin\LoginController');
Route::post('admin/dologin','Admin\LoginController@dologin');

//验证码
Route::get('/vcode','Admin\LoginController@createyzm');